/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * ProjectDto.java
 */
package com.emm.yixun.common.model.dto;

import com.emm.yixun.common.model.Project;
import java.util.LinkedList;
import java.util.List;
import java.util.Date;

import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.Date;

/**
 * [文件名称]<br>
 * ProjectDto.java<br>
 * <br>
 * [文件描述]<br>
 * 房产项目 数据辅助类<br>
 * <br>
 * [修改记录]<br>
 * 2016-05-11 11:27:19 创建 陶俊代码生成器<br>
 * 
 * @author 陶俊代码生成器
 * @version 1.00
 */
public class ProjectDto extends Project {
	private static final long serialVersionUID = 1L;
	/**
	 *需要正序字段名
	 */
	private List<String> asc;
	/**
	 *需要逆序字段名
	 */
	private List<String> desc;
	/**
	 *排序SQL
	 */
	private String orders;
	/**
	 * 需要追加的SQL语句
	 */
	private String sqlAppend;
	
	private String customerId;
	
	//房源状态过滤
	private String roomStatus;
	
	//是要需要权限过滤
	//F: 不需要 其余情况需要
	private String needAuth;
	
	
    
    public String getSqlAppend() {
		return sqlAppend;
	}

	public void setSqlAppend(String sqlAppend) {
		this.sqlAppend = sqlAppend;
	}

	/**
	 *  添加需要正序字段名
	 */
	public void addAsc(String col){
		if(asc==null){
			asc = new LinkedList<String>();
		}
		asc.add(col);
	}
	
	/**
	 *  清空需要正序字段名
	 */
	public void cleanAsc(){
		asc = null;
	}
	
	/**
	 *  添加需要逆序字段名
	 */
	public void addDesc(String col){
		if(desc==null){
			desc = new LinkedList<String>();
		}
		desc.add(col);
	}
	
	/**
	 *  清空需要逆序字段名
	 */
	public void cleanDesc(){
		desc = null;
	}
	
	/**
	 *  如果排序SQL为空根据需要正逆序的字段名拼接排序SQL
	 */
	public String  getOrders() {
		StringBuilder orderStr = null;
		StringBuilder ascStr;
		StringBuilder descStr;
		if(orders==null){
			if(asc!=null){
				ascStr = new StringBuilder();
				orderStr = new StringBuilder();
				String pex = "";
				for(String a : asc){
					ascStr.append(pex+a);
					pex = ",";
				}
				orderStr.append(ascStr.toString()+" ASC");
			}
			if(desc!=null){
				descStr = new StringBuilder();
				String pex = "";
				for(String d : desc){
					descStr.append(pex+d);
					pex = ",";
				}
				if(orderStr==null){
					orderStr = new StringBuilder();
					orderStr.append(descStr.toString()+" DESC");
				}else{
					orderStr.append(","+descStr.toString()+" DESC");
				}
			}
			orders = orderStr!=null?orderStr.toString():null;
		}
		
		return orders;
	}
	
	/**
	 *  设置排序SQL
	 */
	public void setOrders(String orders) {
		this.orders = orders;
	}
	private Date updateTimeBefore;
	private Date updateTimeAfter;
	private Date createTimeBefore;
	private Date createTimeAfter;
	private Date deliveryDateBefore;
	private Date deliveryDateAfter;
	private Date startTimeBefore;
	private Date startTimeAfter;
	private Date salesPermissionDateBefore;
	private Date salesPermissionDateAfter;

    public Date getUpdateTimeBefore() {
        return this.updateTimeBefore;
    }
    public void setUpdateTimeBefore(Date updateTimeBefore) {
        this.updateTimeBefore = updateTimeBefore;
    }

    public Date getUpdateTimeAfter() {
        return this.updateTimeAfter;
    }
    public void setUpdateTimeAfter(Date updateTimeAfter) {
        this.updateTimeAfter = updateTimeAfter;
    }
    public Date getCreateTimeBefore() {
        return this.createTimeBefore;
    }
    public void setCreateTimeBefore(Date createTimeBefore) {
        this.createTimeBefore = createTimeBefore;
    }

    public Date getCreateTimeAfter() {
        return this.createTimeAfter;
    }
    public void setCreateTimeAfter(Date createTimeAfter) {
        this.createTimeAfter = createTimeAfter;
    }
    public Date getDeliveryDateBefore() {
        return this.deliveryDateBefore;
    }
    public void setDeliveryDateBefore(Date deliveryDateBefore) {
        this.deliveryDateBefore = deliveryDateBefore;
    }

    public Date getDeliveryDateAfter() {
        return this.deliveryDateAfter;
    }
    public void setDeliveryDateAfter(Date deliveryDateAfter) {
        this.deliveryDateAfter = deliveryDateAfter;
    }
    public Date getStartTimeBefore() {
        return this.startTimeBefore;
    }
    public void setStartTimeBefore(Date startTimeBefore) {
        this.startTimeBefore = startTimeBefore;
    }

    public Date getStartTimeAfter() {
        return this.startTimeAfter;
    }
    public void setStartTimeAfter(Date startTimeAfter) {
        this.startTimeAfter = startTimeAfter;
    }
    public Date getSalesPermissionDateBefore() {
        return this.salesPermissionDateBefore;
    }
    public void setSalesPermissionDateBefore(Date salesPermissionDateBefore) {
        this.salesPermissionDateBefore = salesPermissionDateBefore;
    }

    public Date getSalesPermissionDateAfter() {
        return this.salesPermissionDateAfter;
    }
    public void setSalesPermissionDateAfter(Date salesPermissionDateAfter) {
        this.salesPermissionDateAfter = salesPermissionDateAfter;
    }

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	public String getRoomStatus() {
		return roomStatus;
	}

	public void setRoomStatus(String roomStatus) {
		this.roomStatus = roomStatus;
	}

	public String getNeedAuth() {
		return needAuth;
	}

	public void setNeedAuth(String needAuth) {
		this.needAuth = needAuth;
	}
    
    
	
}
